subroutine check_readdiff(cunit)
  use param
  use global_param,only:n_point_type
  use global_param,only:pdefect
  use label_data_param,only:n_obj_type
  use label_data_param,only:obj_type
  implicit none

  integer,intent(in) :: cunit

  integer :: i,j,pos1,pos2
  integer :: in1,in2,in3
  character(len=len_linebuf) :: str

  in1=1
  in2=2
  in3=3

  call log_msg1(cunit,"")
  call log_msg1(cunit,"Checking diffusion file...")
  call log_msg1(cunit,"")

  do i=1,n_obj_type
     pos1=16
     ! Original labels
     write(str(1:pos1),'("[",i5.5,"]",1x,a8)') i,obj_type(i)%name
     ! Configuration 
     do j=1,n_point_type
        pos2=pos1+10
        write(str(pos1+1:pos2),'(3x,i7)') obj_type(i)%config(j)
        pos1=pos2
     end do
     ! Total size
     pos2=pos1+9
     write(str(pos1+1:pos2),'(1x,i8)') obj_type(i)%total_size
     ! write the label info.
     call log_msg1_indent(cunit,in1,str(1:pos2))

     ! does move
     if (obj_type(i)%does_move) then
        write(str,'("> Mobile")')
        call log_msg1_indent(cunit,in2,str)
        ! energy barrier
        ! prefactor
        pos1=1
        pos2=12
        write(str(pos1:pos2),'("Eb=",1pe8.2,",")') &
             obj_type(i)%diff_eb
        pos1=13
        pos2=24
        write(str(pos1:pos2),'("Nu=",1pe8.2)') &
             obj_type(i)%diff_nu
        call log_msg1_indent(cunit,in2,str(1:pos2))
     else
        write(str,'("> immobile")')
        call log_msg1_indent(cunit,in2,str)
     end if
  end do

  return

end subroutine check_readdiff
